home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 3 / csmp-digest-v3-127 < prev    next >
Text File  |  1995-12-31  |  82KB  |  2,102 lines

  1. C.S.M.P. Digest             Mon, 11 Dec 95       Volume 3 : Issue 127
  2.  
  3. Today's Topics:
  4.  
  5.         Audio CD related toolbox routines?
  6.         Changing default directory of StandardGetFile
  7.         Creating AppleEvents
  8.         Curious question about process mgr-A4
  9.         Determining if a volume is local or not
  10.         Developer VISE Code Resources?
  11.         Experience with Zinc-Galaxy-Neuron Data?
  12.         Floating menus sink my dialogs
  13.         GetAppFiles - link error?
  14.         How to get a folder's volume information!
  15.         Random number seed dreaming.
  16.         SAT 2.3.5 is out!
  17.         Where to store the sprite-graphics?
  18.         [Q] Color-Picker Popup Menu?
  19.         [Q] How to hit-test a PICT?
  20.         multi-player keyboard control
  21.  
  22.  
  23.  
  24. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  25. (pottier@clipper.ens.fr).
  26.  
  27. The digest is a collection of article threads from the internet
  28. newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
  29. csmp.games. It is designed for people who read news semi-regularly and
  30. want an archive of the discussions.  If you don't know what a
  31. newsgroup is, you probably don't have access to it. Ask your systems
  32. administrator(s) for details. If you don't have access to news, you
  33. may still be able to post messages to the group by using a mail server
  34. like anon.penet.fi (mail help@anon.penet.fi for more information).
  35.  
  36. Each issue of the digest contains one or more sets of articles (called
  37. threads), with each set corresponding to a 'discussion' of a particular
  38. subject.  The articles are not edited; all articles included in this digest
  39. are in their original posted form (as received by our news server at
  40. nef.ens.fr).  Article threads are not added to the digest until the last
  41. article added to the thread is at least two weeks old (this is to ensure that
  42. the thread is dead before adding it to the digest).  Article threads that
  43. consist of only one message are generally not included in the digest.
  44.  
  45. The digest is officially distributed by two means, by email and ftp.
  46.  
  47. If you want to receive the digest by mail, send email to listserv@ens.fr
  48. with no subject and one of the following commands as body:
  49.     help                                Sends you a summary of commands
  50.     subscribe csmp-digest Your Name     Adds you to the mailing list
  51.     signoff csmp-digest                 Removes you from the list
  52. Once you have subscribed, you will automatically receive each new
  53. issue as it is created.
  54.  
  55. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  56. Questions related to the ftp site should be directed to
  57. scott.silver@dartmouth.edu.
  58.  
  59. -------------------------------------------------------
  60.  
  61. >From Greg Maddigan <gregm@atlas.otago.ac.nz>
  62. Subject: Audio CD related toolbox routines?
  63. Date: 22 Nov 1995 02:53:15 GMT
  64. Organization: University of Otago, Dunedin, NZ
  65.  
  66. What toolbox routines do the apps like Audio CD Player use to obtain the
  67. lengths of each track of an audio CD?
  68. Are there any snippets of sample code anywhere?
  69.  
  70.  
  71. +++++++++++++++++++++++++++
  72.  
  73. >From quesnel@music.mcgill.ca (René Quesnel)
  74. Date: Wed, 22 Nov 1995 17:09:04 -0500
  75. Organization: Faculty of Music, McGill University
  76.  
  77. In article <48u3ar$65o@celebrian.otago.ac.nz>, Greg Maddigan
  78. <gregm@atlas.otago.ac.nz> wrote:
  79.  
  80. > What toolbox routines do the apps like Audio CD Player use to obtain the
  81. > lengths of each track of an audio CD?
  82. > Are there any snippets of sample code anywhere?
  83.  
  84. You need:
  85. 1. The technical note about the CD-ROM driver calls at
  86. http://www.info.apple.com/dev/technotes/Devices/dv_22.html
  87.  
  88. 2. Code sample at:
  89. http://dev.info.apple.com/source/code/Snippets/Devices/Audio_CD__/ReadMe.html
  90.  
  91. You might also want the information about the CD remote database format at:
  92. http://www.info.apple.com/dev/technotes/Devices/dv_25.html
  93.  
  94. - ----------------------------------------------------------------------------
  95. Rene Quesnel                                | voice:  (514)398-4548, x0523
  96. Music Technology and Sound Recording Areas  | fax:    (514)398-8061
  97. Faculty of Music, McGill University         | e-mail: quesnel@music.mcgill.ca
  98. 555 Sherbrooke St.W. Montreal (QC), Canada  |
  99. H3A 1E3                                     |
  100. - ----------------------------------------------------------------------------
  101.  
  102. +++++++++++++++++++++++++++
  103.  
  104. >From phixus@deltanet.com (Chris De Salvo)
  105. Date: Mon, 27 Nov 1995 03:05:20 -0800
  106. Organization: MacPlay
  107.  
  108. In article <48u3ar$65o@celebrian.otago.ac.nz>, Greg Maddigan
  109. <gregm@atlas.otago.ac.nz> wrote:
  110.  
  111. >What toolbox routines do the apps like Audio CD Player use to obtain the
  112. >lengths of each track of an audio CD?
  113. >Are there any snippets of sample code anywhere?
  114.  
  115. You have to use the Device Manager calls and go through the CD-ROM
  116. driver.  The driver calls are documented in the Mac tech notes for
  117. devices.  It is Tech Note DV 22.
  118.  
  119. L8R
  120. Chris
  121.  
  122. -- 
  123. phixus@deltanet.com         |   Macintosh:  Changing the world,
  124. Chris De Salvo              |        one person at a time!
  125. Professional Mac Geek       |    -----------------------------
  126. for MacPlay, Inc.           |      (I wish they'd hurry up!)
  127.  
  128.            http://www.deltanet.com/users/phixus
  129.  
  130. ---------------------------
  131.  
  132. >From jstiles@cello.gina.calstate.edu (John Stiles)
  133. Subject: Changing default directory of StandardGetFile
  134. Date: Fri, 24 Nov 1995 07:07:46 GMT
  135. Organization: cello.gina.calstate.edu
  136.  
  137.  Hi! I am writing a program which opens an encoded file, then decodes the
  138. contents into a new folder. The user then must pick a file from inside the
  139. new folder. I would like to be able to set StandardGetFile to open in this
  140. new folder, rather than forcing the user to open the new folder manually
  141. every time. I think I have seen other programs do this--but how?
  142.  
  143.  Thanks for any help you can give...
  144.  *Stiles
  145.  
  146. +++++++++++++++++++++++++++
  147.  
  148. >From Dave Overton <doverton@iglou.com>
  149. Date: Sat, 25 Nov 1995 14:34:44 GMT
  150. Organization: DataStream Imaging Systems, Inc.
  151.  
  152. CurDirStore
  153. SFSaveDisk
  154.  
  155. are two low memory globals where the Standard File Package
  156. stores its current DirID and vRefNum. You should be able to
  157. pop these before calling SFGetFile.
  158. Dave Overton
  159.  
  160. +++++++++++++++++++++++++++
  161.  
  162. >From rdwells@mmm.com (Richard Wells )
  163. Date: 27 Nov 1995 19:15:18 GMT
  164. Organization: 3M Company
  165.  
  166. jstiles@cello.gina.calstate.edu (John Stiles) wrote:
  167. > Hi! I am writing a program which opens an encoded file, then decodes the
  168. >contents into a new folder. The user then must pick a file from inside the
  169. >new folder. I would like to be able to set StandardGetFile to open in this
  170. >new folder, rather than forcing the user to open the new folder manually
  171. >every time. I think I have seen other programs do this--but how?
  172.  
  173. Dave Overton <doverton@iglou.com> responded:
  174. >CurDirStore
  175. >SFSaveDisk
  176. >are two low memory globals where the Standard File Package
  177. >stores its current DirID and vRefNum. You should be able to
  178. >pop these before calling SFGetFile.
  179.  
  180. To do this reliably under System 7.5, you must use a standard file
  181. hook function and modify the StandardFileReply record's sfFile
  182. field to refer to the volume and folder you want in response to
  183. the sfHookFirstCall message.  This is necessary under 7.5 because
  184. users can use the General Preferences control panel to modify the
  185. behavior of the standard file package.
  186.  
  187. _Inside Macintosh: Files_ has an example of doing this.
  188.  
  189. Any time I do this, I also save the current CurDirStore and
  190. SFSaveDisk in the sfHookFirstCall message and restore them
  191. during the sfHookLastCall message.
  192.  
  193. One more thing: don't forget to return sfHookChangeSelection
  194. from the sfHookFirstCall message if you change the reply
  195. record's sfFile field.
  196.  
  197. Yet one more thing: When you modify sfFile.parID and sfFile.vRefNum,
  198. also set sfFile.name to an empty string.  If you leave random
  199. garbage in there, you can crash the system.
  200.  
  201.  
  202.  
  203. ---------------------------
  204.  
  205. >From kellys@cs.stanford.edu (Kelly Schwarzhoff)
  206. Subject: Creating AppleEvents
  207. Date: Fri, 24 Nov 1995 23:28:39 -0800
  208. Organization: Stanford University
  209.  
  210. I'm trying for the first time to send Apple Events, and can't seem to get
  211. them to work (if it matters, I'm using Codewarrior 7).  I have the
  212. following code:
  213.  
  214.    OSErr       err1;
  215.    OSErr       err2;
  216.    OSErr       err3;
  217.    OSErr       err4;
  218.    FInfo       fileinfo;
  219.    AEDesc      dest;
  220.    AppleEvent  OpenAppEvent;
  221.    AppleEvent  Reply;
  222.    
  223.  
  224.    err1 = ::HGetFInfo(mPreviewer.vRefNum, mPreviewer.parID,
  225. mPreviewer.name, &fileinfo);
  226.    err2 = ::AECreateDesc(typeApplSignature, &fileinfo.fdCreator,
  227. sizeof(fileinfo.fdCreator), &dest);
  228.    err3 = ::AECreateAppleEvent(kCoreEventClass, kAEOpenApplication, &dest,
  229. kAutoGenerateReturnID,
  230.     kAnyTransactionID, &OpenAppEvent); 
  231.    err4 = ::AESend(&OpenAppEvent, &Reply, kAENoReply, kAENormalPriority,
  232. kAEDefaultTimeout, NULL, NULL);
  233.  
  234.  
  235. mPreviewer is an FSSpec which holds the application's information.
  236.  
  237. The problem is that err4 returns -609, which means I'm passing an invalid
  238. Signature.  However, I've checked it (and ran it with multiple different
  239. programs/signatures), and the signature appears to be correct.  All of the
  240. other err's return 0.  Suggestions?  Is there a better way to do this?  Is
  241. this the correct way? I've never sent an apple event (and receiving them
  242. in Codewarrior is so trivial you really never deal with the toolbox), so
  243. I'm not sure what the correct approach is.
  244.  
  245. -- 
  246. Kelly Schwarzhoff                     kellys@cs.stanford.edu
  247. MIME Mail is welcome
  248.  
  249. +++++++++++++++++++++++++++
  250.  
  251. >From brians@pbcomputing.com (Brian Stern)
  252. Date: Sat, 25 Nov 1995 17:15:12 -0600
  253. Organization: The University of Texas at Austin, Austin, Texas
  254.  
  255. Kelly,
  256.  
  257. You can't send an appleevent to a file; you have to send it to a running
  258. process.  Contrary to what you were thinking you can't start an
  259. application by sending an oapp event.  There is never any reason to send
  260. an oapp event.  They're sent by the process manager when an app is
  261. started.
  262.  
  263. Your code looks basically fine.  Try sending a quit event to a running
  264. process and try using a psn to generate the address desc.
  265.  
  266. Good luck,
  267.  
  268. ____________________________________________________________________
  269. Brian  Stern  {8-{)}                                 BeBox Hairy Guy                  Stern@metrowerks.com                          BrianS@pbcomputing.com
  270. INIT Writing FAQ etc. at <ftp://ftp.pbcomputing.com//Guests/BrianS/>
  271.  
  272. +++++++++++++++++++++++++++
  273.  
  274. >From tulip@tiac.net (Ed Anson)
  275. Date: Sat, 25 Nov 1995 20:55:15 -0500
  276. Organization: Tulip Software
  277.  
  278. In article <brians-2511951715120001@slip-16-7.ots.utexas.edu>,
  279. brians@pbcomputing.com (Brian Stern) wrote:
  280.  
  281. > You can't send an appleevent to a file; you have to send it to a running
  282. > process.  Contrary to what you were thinking you can't start an
  283. > application by sending an oapp event.  There is never any reason to send
  284. > an oapp event.  They're sent by the process manager when an app is
  285. > started.
  286.  
  287. That is basically correct. However, it is the Finder that sends oapp when
  288. you open an application. If you use the Process Manager to start an app,
  289. you are obligated to send the oapp. Some applications behave rather
  290. strangely if they don't receive that event after launch.
  291.  
  292. Incidentally, you can also use AppleScript to launch an application
  293. without sending oapp. The Launch command does this. OTOH, simply
  294. mentioning the application in a Tell command launches the app (if
  295. necessary) and automatically sends oapp.
  296.  
  297. - --------------------
  298. Ed Anson
  299. Tulip Software
  300. Andover, MA 01810   Check out my WWW page:
  301. U.S.A.              <http://www.tiac.net/users/tulip/home.html>
  302.  
  303. +++++++++++++++++++++++++++
  304.  
  305. >From jwbaxter@olympus.net (John W. Baxter)
  306. Date: Sun, 26 Nov 1995 00:27:35 -0800
  307. Organization: Townsend Communications
  308.  
  309. In article <brians-2511951715120001@slip-16-7.ots.utexas.edu>,
  310. brians@pbcomputing.com (Brian Stern) wrote:
  311.  
  312. > There is never any reason to send
  313. > an oapp event.  They're sent by the process manager when an app is
  314. > started.
  315.  
  316. Actually, there is *one* reason I can think of:  to validate the behavior
  317. of one's app when a subsequent 'oapp' comes in.  Apple seems to be
  318. changing its mind on this...it may be, sometime in the future, that Finder
  319. will trigger a new 'oapp' if a running app is double-clicked.  [User
  320. testing is showing that simply bringing a left-over, windowless app to the
  321. front may not be the best thing for the system to do.]  So the "right"
  322. behavior may become to do the same thing whenever an 'oapp' shows up that
  323. the app does if 'oapp' preceeds 'odoc' or 'pdoc'.  Or it may not.
  324.  
  325. Then there was an early version of FileMaker, which *attempted* to remove
  326. its 'aevt'/'oapp' handler once one of the three events had arrived.  But
  327. it made the call incorrectly, and the handler remained.  ["Who knows what
  328. evil lurks in the hearts of applications?  AETracker knows..."]
  329.  
  330.    --John
  331.  
  332. -- 
  333.   "This item is not available because it cannot be removed."
  334. John W. Baxter    Port Ludlow, WA     jwbaxter@olympus.net
  335.  
  336. +++++++++++++++++++++++++++
  337.  
  338. >From brians@pbcomputing.com (Brian Stern)
  339. Date: Sun, 26 Nov 1995 14:36:14 -0600
  340. Organization: The University of Texas at Austin, Austin, Texas
  341.  
  342. In article <tulip-2511952055150001@tulip.tiac.net>, tulip@tiac.net (Ed
  343. Anson) wrote:
  344.  
  345. <In article <brians-2511951715120001@slip-16-7.ots.utexas.edu>,
  346. <brians@pbcomputing.com (Brian Stern) wrote:
  347. <
  348. <> You can't send an appleevent to a file; you have to send it to a running
  349. <> process.  Contrary to what you were thinking you can't start an
  350. <> application by sending an oapp event.  There is never any reason to send
  351. <> an oapp event.  They're sent by the process manager when an app is
  352. <> started.
  353. <
  354. <That is basically correct. However, it is the Finder that sends oapp when
  355. <you open an application. If you use the Process Manager to start an app,
  356. <you are obligated to send the oapp. Some applications behave rather
  357. <strangely if they don't receive that event after launch.
  358.  
  359. This is not correct.  I quote from IM VI p 29-14:
  360.  
  361. "If you set this field to NIL [the launchAppParameters field], the
  362. LaunchApplication function automatically creates and sends an Open
  363. Application event to the launched application."
  364.  
  365. You can launch an app using the process manager call LaunchApplication. 
  366. If you do so you can specify an odoc event or any other high level event
  367. to be the first event sent to the application.  If you don't specify any
  368. event then the process manager sends an oapp for you.  There is never any
  369. reason for normal applications to explicitely send an oapp event.
  370.  
  371. ____________________________________________________________________
  372. Brian  Stern  {8-{)}                                 BeBox Hairy Guy                  Stern@metrowerks.com                          BrianS@pbcomputing.com
  373. INIT Writing FAQ etc. at <ftp://ftp.pbcomputing.com//Guests/BrianS/>
  374.  
  375. ---------------------------
  376.  
  377. >From bhaglind@mv.mv.com (Intellilink Corp.)
  378. Subject: Curious question about process mgr-A4
  379. Date: Tue, 14 Nov 1995 16:19:38 GMT
  380. Organization: MV Communications, Inc.
  381.  
  382. Just wondered if anyone in netland has successfully inserted either a filter
  383. proc or an AEEventHandler from a Code Resource ( which uses A4 ) instead 
  384. of from an application.  If you have, what gotcha's have you encountered.
  385.  
  386. I finally did manage to work with Ole on the Macintosh, in a limited and 
  387. strange and wonderful way.  Had I any choice in the matter, I would NOT
  388. have chosen to deal with Ole at all.  Ah well.
  389.  
  390. Thanks for any info on AEHandlers living in code resources.
  391.  
  392. B. Haglind
  393.  
  394.  
  395.  
  396.  
  397. +++++++++++++++++++++++++++
  398.  
  399. >From skevill@tartarus.uwa.edu.au (Scott Kevill)
  400. Date: Thu, 16 Nov 1995 15:05:30 +0800
  401. Organization: The University of Western Australia
  402.  
  403. In article <DI1K0q.L8F@mv.mv.com>, bhaglind@mv.mv.com (Intellilink Corp.) wrote:
  404.  
  405. : Just wondered if anyone in netland has successfully inserted either a filter
  406. : proc or an AEEventHandler from a Code Resource ( which uses A4 ) instead 
  407. : of from an application.  If you have, what gotcha's have you encountered.
  408. : I finally did manage to work with Ole on the Macintosh, in a limited and 
  409. : strange and wonderful way.  Had I any choice in the matter, I would NOT
  410. : have chosen to deal with Ole at all.  Ah well.
  411. : Thanks for any info on AEHandlers living in code resources.
  412. : B. Haglind
  413.  
  414. I believe it is not possible to have a code resource receive AppleEvents
  415. since they can only be addressed to an application (or background only
  416. application). It may be possible for a code resource to install
  417. AEEventHandlers and receive AppleEvents meant for an application, but I
  418. have not tried this. However sending  AppleEvents from a code resource is
  419. fine and fairly straight-forward. What kind of AppleEvents are you wanting
  420. to receive in a code resource?
  421.  
  422. Scott Kevill.
  423. skevill@tartarus.uwa.edu.au
  424.  
  425. +++++++++++++++++++++++++++
  426.  
  427. >From S.W.Lay@damtp.cam.ac.uk (Steve Lay)
  428. Date: Wed, 22 Nov 1995 09:41:32 +0000
  429. Organization: DAMTP, Cambridge University
  430.  
  431. I once installed an AppleEvent handler from an XCMD running with HyperCard
  432. and it worked fine - as long as the parent application doesn't do anything
  433. stupid, is HLE aware and uses the AEProcessAppleEvent call you should be
  434. alright.
  435.  
  436. However, you should check out the rules which the parent application
  437. applies to your code to ensure that the event handler you install doesn't
  438. move.  Eg, HyperCard may well move the code for an XCMD around in the heap
  439. without telling you - for this reason I achieved it by loading a separate
  440. code resource, detaching it, locking it and then installing it.  I think I
  441. converted the handle to hex and put it in an HC global or something so
  442. that I could clean it up when I quit.
  443.  
  444. -- 
  445. Steve Lay
  446. S.W.Lay@damtp.cam.ac.uk
  447. http://www.amtp.cam.ac.uk/icrd/
  448.  
  449. ---------------------------
  450.  
  451. >From brads79436@aol.com (BradS79436)
  452. Subject: Determining if a volume is local or not
  453. Date: 22 Nov 1995 19:56:37 -0500
  454. Organization: America Online, Inc. (1-800-827-6364)
  455.  
  456. How does one determine if a volume is local or remote (networked,
  457. AppleShare, etc.) ?  PBHGetVInfo() gives me access to a bunch of
  458. information, but that's not among it.  Do I have to come in from the
  459. AppleShare side ?
  460.  
  461. Thanks for any help
  462.  
  463. Brad Smith
  464. BookWorm
  465.  
  466. +++++++++++++++++++++++++++
  467.  
  468. >From jumplong@aol.com (Jump Long)
  469. Date: 23 Nov 1995 06:05:44 -0500
  470. Organization: America Online, Inc. (1-800-827-6364)
  471.  
  472. Brad Smith (brads79436@aol.com) wrote:
  473. >How does one determine if a volume is local or remote
  474. >(networked, AppleShare, etc.) ?  PBHGetVInfo() gives me access
  475. >to a bunch of information, but that's not among it.  Do I have
  476. >to come in from the AppleShare side ?
  477.  
  478. You want to use PBHGetVolParms and check the vMServerAdr field of the
  479. GetVolParmsInfoBuffer that's returned. If its zero, the volume is local.
  480. Using the high-level calls and macros for checking GetVolParmsInfoBuffer
  481. fields in the MoreFiles sample code makes this rather easy as shown here:
  482.  
  483. Boolean IsNetworkVolume(StringPtr volName, short vRefNum)
  484. {
  485.  GetVolParmsInfoBuffer volParmsInfo;
  486.  long infoSize;
  487.  
  488.  infoSize = sizeof(GetVolParmsInfoBuffer);
  489.  if ( HGetVolParms(volName, vRefNum, &volParmsInfo, &infoSize) == noErr )
  490.  {
  491.   /* If volume supports GetVolParms, see if it is a network volume */
  492.   return ( isNetworkVolume(volParmsInfo) );
  493.  }
  494.  else
  495.  {
  496.   /* Volume doesn't support GetVolParms, so it isn't a network volume */
  497.   return ( false );
  498.  }
  499. }
  500.  
  501. HGetVolParms is a MoreFiles function and isNetworkVolume is a MoreFile
  502. macro.
  503.  
  504. - Jim Luther
  505.  
  506. ---------------------------
  507.  
  508. >From cvanveen@bnr.ca (Christine van Veen)
  509. Subject: Developer VISE Code Resources?
  510. Date: Sun, 26 Nov 1995 16:19:01 -0400
  511. Organization: Bell-Northern Research/Northern Telecom
  512.  
  513. I have good knowledge of C programming in the PC and Unix environment.  I
  514. have been attempting to learn to write code resources in C for use with
  515. Developer VISE - with very little success.  Can anyone explain to me what
  516. is necessary to write a code resource for Developer VISE?
  517.  
  518. Currently, I am working on writing a code resource to "age" a file.  This
  519. means that, before a file is installed, the code resource will:
  520.  
  521. * search for the file to be installed, in case it already exists
  522. * if the file exists, rename the file to some unique name
  523.       e.g.  "TheFile"  might become  "TheFile.11.32"
  524.                if the file is renamed at 11:32 a.m.
  525.  
  526. If anyone has experience with this, I would really appreciate hearing any
  527. suggestions.
  528.  
  529. - Christine van Veen
  530.  
  531. **********************************************
  532.   Christine van Veen       cvanveen@bnr.ca      
  533.   Mac/Unix Systems Integration  
  534.   Bell Northern Research              
  535.   Phone:  763-7844   Fax: 763-3283
  536. **********************************************
  537.  
  538. +++++++++++++++++++++++++++
  539.  
  540. >From David.Walton.10@nd.edu (David Walton)
  541. Date: Mon, 27 Nov 1995 18:46:47 -0500
  542. Organization: University of Notre Dame
  543.  
  544. In article <cvanveen-2611951619010001@47.199.32.68>, cvanveen@bnr.ca
  545. (Christine van Veen) wrote:
  546.  
  547. >I have good knowledge of C programming in the PC and Unix environment.  I
  548. >have been attempting to learn to write code resources in C for use with
  549. >Developer VISE - with very little success.  Can anyone explain to me what
  550. >is necessary to write a code resource for Developer VISE?
  551. >
  552. >Currently, I am working on writing a code resource to "age" a file.  This
  553. >means that, before a file is installed, the code resource will:
  554. >
  555. >* search for the file to be installed, in case it already exists
  556. >* if the file exists, rename the file to some unique name
  557. >      e.g.  "TheFile"  might become  "TheFile.11.32"
  558. >               if the file is renamed at 11:32 a.m.
  559. >
  560. >If anyone has experience with this, I would really appreciate hearing any
  561. >suggestions.
  562.  
  563. Here's a very brief external that I use to check for the existence of
  564. OpenTransport in an installer I wrote.  It's pretty straightforward:  just
  565. link with the right libraries, get the right parameters, and you're home
  566. free.  I have written something that vaguely resembles what you're
  567. specifically looking for, so if you'd like to discuss more details, e-mail
  568. me. 
  569.  
  570. (Also, please excuse the ugliness of the code.)
  571.  
  572. David Walton
  573.  
  574.  
  575.  
  576. #ifndef __EXTERNCODEDEFINES__
  577. #include <ExternCodeDefines.h>
  578. #endif
  579. #include <Gestalt.h>
  580. #ifndef gestaltOpenTransportAttr
  581. #define gestaltOpenTransportAttr 'otan'
  582. #endif
  583.  
  584. #define kTestHasOT      1
  585. #define kTestHasMacTCP  2
  586.  
  587. pascal void main (ExternParmBlock *PB);
  588.  
  589.  
  590.  
  591. /* ====================================================================
  592.  
  593.    main
  594.    
  595.    ==================================================================== */
  596.  
  597. pascal void main (ExternParmBlock *PB)
  598. {
  599.    long     gestaltValue;
  600.    Boolean  hasOT = false;
  601.    OSErr    error;
  602.    
  603.    error = Gestalt(gestaltOpenTransportAttr, &gestaltValue);
  604.    if (!error && gestaltValue != 0)
  605.       hasOT = true;
  606.    switch (PB->refCon)
  607.    {
  608.       case kTestHasOT:
  609.          PB->installFork = (hasOT  ?  PB->installFork  :  kDontInstallFile);
  610.          break;
  611.       case kTestHasMacTCP:
  612.          PB->installFork = (hasOT  ?  kDontInstallFile  :  PB->installFork);
  613.          break;
  614.       default: /* This should never be called  */
  615.          PB->installFork = kDontInstallFile;
  616.          break;
  617.    }
  618. }
  619.  
  620. -- 
  621. David Walton                    |  Macintosh Consultant & Graduate Student
  622. Mailto:David.Walton.10@nd.edu   |  Office of Information Technologies 
  623. http://www.nd.edu/~dwalton1/    |  Dept. History & Philosophy of Science
  624. Voice: 219-631-8024             |  University of Notre Dame
  625.  
  626.    "Beware the advice of successful people; they do not seek company."   
  627.  
  628. ---------------------------
  629.  
  630. >From baileyc@beetle.com (Christopher R. Bailey)
  631. Subject: Experience with Zinc-Galaxy-Neuron Data?
  632. Date: Tue, 14 Nov 1995 09:45:02 -0800
  633. Organization: Beetle's Sprawl
  634.  
  635. I am conducting an investigation into cross platform frameworks for my
  636. company.  We have an existing product that is cross platform (Mac &
  637. Windows) using our own cross platform framework.  We'd like to move to a
  638. commercial product to attain more GUI features, not have to worry about
  639. maintaining the framework ourselves, possibly pick up international
  640. support and database connectivity, etc.
  641.  
  642. I started with a list including Galaxy, Neuron Data, XVT, Zinc, StarView,
  643. ParcPlace VisualWorks, zApp, C++/Views, Utah, MFC, ODF, and Prograph.  We
  644. require that Mac, PowerMac, Windows 95, Windows NT (Intel and preferably
  645. Alpha), and possibly Windows 3.1 be supported, and that the product be a
  646. C++ product, preferably supporting a MVC paradigm.  Our initial
  647. investigation included two non-C++ products as they seemed to have enough
  648. compelling arguments to look at them.
  649.  
  650. As of now, we've narrowed the field down to Neuron Data's Open Interface
  651. Elements (and possibly C/S Elements), Visix's Galaxy, and Zinc's Zinc
  652. Application Framework.  With Neuron Data, we will base our evaluation on
  653. the next release (March/April '96) as it's claimed to be a much better C++
  654. product.  We are also interested in Visix's upcoming Galaxy Global
  655. (version for creating international/Unicode/multi-byte apps), as well as
  656. Zinc's international offering.  At this time price is not a major factor
  657. in the decision.  Also we probably won't be making a decision for several
  658. months, which allows us to look at the upcoming releases from some of
  659. these companies.
  660.  
  661. What I'd like to find out is who has chosen one of these products, and for
  662. what reasons.  More importantly, I'd like to find people who've chosen
  663. Zinc/Galaxy/Open Interface when comparing these three (and/or others).  
  664.  
  665. Any information you feel like providing would be much appreciated.  Please
  666. email me as well (Chris_Bailey@hysoft.com).  Specifically I'd be
  667. interested in your opinions of the companies, the tech support, the
  668. features of the product, use of the GUI design tool, experience using I18N
  669. features/abilities (which I guess mainly pertains to Zinc at this point),
  670. documentation, training, etc.  Thanks in advance!
  671.  
  672. _____________ Christopher R. Bailey _____________
  673. baileyc@beetle.com
  674. http://www.quake.net/~baileyc
  675. Macintosh, for those who can see through Windows.
  676. Ride fast, take chances!
  677.  
  678. +++++++++++++++++++++++++++
  679.  
  680. >From sean@corf.demon.co.uk (Sean A Corfield)
  681. Date: Wed, 15 Nov 1995 12:11:57 +0000
  682. Organization: OCS
  683.  
  684. In article <baileyc-1411950945020001@beetle.com>,
  685. baileyc@beetle.com (Christopher R. Bailey) wrote:
  686.  
  687. |> What I'd like to find out is who has chosen one of these products, and
  688. for
  689. |> what reasons.  More importantly, I'd like to find people who've chosen
  690. |> Zinc/Galaxy/Open Interface when comparing these three (and/or others).
  691.  
  692. I worked for a company that went through a similar evaluation process and
  693. picked Zinc. Neuron Data was simply too expensive -- it had a run-time
  694. licence at the time. Galaxy was too all-encompassing for what we needed
  695. (just a GUI, no O/S service layer). Zinc has some peculiar C++ idioms and a
  696. steep learning curve (not as steep as Galaxy, I'd say). However, there were
  697. many, many problems with the Motif version of Zinc and I just heard that my
  698. old company has junked the project (and reverted to custom-building their
  699. Motif and Windows interfaces). Zinc admitted that their Motif port was very
  700. buggy and claimed that the forthcoming v5.x will be enough of a rewrite to
  701. solve this.
  702.  
  703. I have since heard of similar problems with Zinc in a Windows environment
  704. (my old company never got as far as completing the Windows port to discover
  705. whether this is true or not).
  706.  
  707. Sean A. Corfield
  708. Technical Director
  709. Object Consultancy Services
  710.  
  711.  
  712.  
  713.  
  714. +++++++++++++++++++++++++++
  715.  
  716. >From gorasche@iicm.tu-graz.ac.at (Gerbert Orasche)
  717. Date: 17 Nov 1995 21:53:47 GMT
  718. Organization: IICM
  719.  
  720. In article <baileyc-1411950945020001@beetle.com>, baileyc@beetle.com 
  721. says...
  722. >
  723. >I am conducting an investigation into cross platform frameworks for my
  724. >company.  We have an existing product that is cross platform (Mac &
  725. >Windows) using our own cross platform framework.  We'd like to move to a
  726. >commercial product to attain more GUI features, not have to worry about
  727. >maintaining the framework ourselves, possibly pick up international
  728. >support and database connectivity, etc.
  729. I am cross-developing for Windows 3.x,95,NT,Mac, and PowerMac using 
  730. Microsofts tools. I am now porting an VRML viewer to Mac, with the cross 
  731. development toolkit for Macintosh. It works quite fine (full MFC support), 
  732. but I do not now very much about performance yet.
  733.  
  734. cu
  735. -- 
  736. Gerbert Orasche at Graz University Of Technology
  737. IICM (Institute for Information Processing and Computer Supported New 
  738. Media)  
  739. Inter-Net gorasche@iicm.tu-graz.ac.at
  740.           orasche@flinux.tu-graz.ac.at
  741. Tel-Net   ++43-316-873-5607
  742. http://hyperg.iicm.tu-graz.ac.at/TU-5060.Pers.gorasche
  743.  
  744.  
  745. +++++++++++++++++++++++++++
  746.  
  747. >From bvk@chelsea.ios.com (Brett Kuehner)
  748. Date: Sat, 18 Nov 1995 04:24:55 GMT
  749. Organization: Internet Online Services
  750.  
  751. On Tue, 14 Nov 1995 09:45:02 -0800, baileyc@beetle.com (Christopher R.
  752. Bailey) wrote:
  753.  
  754. >I am conducting an investigation into cross platform frameworks for my
  755. >company. 
  756.  
  757. I did very much the same thing, around a year and a half ago. I looked
  758. at Zinc, Visix Galaxy, Neuron Data, zApp, and a half-dozen others
  759. (most of the ones on your list). The main contenders I saw were Galaxy
  760. and Neuron Data, mostly because they seemed to be well-designed, and
  761. not just a pile of C++ classes. They both also had some kind of
  762. scripting support. However, they were both very expensive (thousands
  763. of dollars per developer seat).
  764.  
  765. I liked Galaxy quite a bit, and a demo that I saw of their interface
  766. builder leads me to believe their builder is (was a year ago, anyway)
  767. far superior to Neuron Data, supporting a nice visual layout mechanism
  768. of springs and struts, among other things. For their other stuff,
  769. Galaxy and Neuron Data both seemed to have their good and bad points.
  770. Neither had mature C++ support at the time, although this seems to
  771. have improved for both.
  772.  
  773. My final decision was to get Neuron Data. This was based mainly on two
  774. factors:
  775. 1) Neuron Data was cheaper than Galaxy (by a thousand or two per seat,
  776. at least)
  777.  
  778. 2) Most importantly, Neuron Data offered an evaluation copy that made
  779. it easy to see it it was suitable for my project. They were very easy
  780. to deal with (my salesperson, Jenny Leipziger, was very helpful. I
  781. recommend her if you want any questions answered), and they gave me
  782. eval copies for both Sun Sparc and PC/Windows without any hassle.
  783.  
  784. Visix, on the other hand, would not give me a demo no matter how hard
  785. I tried. The best I could do was to get a set of manuals (C manuals,
  786. at that. They said the C++ manuals weren't ready yet). To check out
  787. the Galaxy features, Visix recommended taking a week-long course at
  788. their site in Virginia. This is hardly practical, not even considering
  789. the expense of travel and lodging, since trying to get away from work
  790. for a week just for an evaluation is kind of extreme (and impossible).
  791.  
  792. Anyhow, Neuron Data worked out pretty well for the project that I was
  793. leading (real-time financial information display on 486/66 PC's
  794. running Windows 3.11). Tech support was pretty responsive, although
  795. they took a while to respond to some of the bugs. Graphics performance
  796. was good, once we figured out the way to optimize drawing.
  797. The event model ND uses is good, and made it easy to have an event
  798. architecture that would have been difficult to do in plain windows. It
  799. also did not seem to interfere with using Windows API calls intermixed
  800. in the code, so you can get at DDE and other functions which are (or
  801. were) not supported directly by ND.
  802. Neuron Data did not support some of the compilers that I wanted to use
  803. uner Windows, so check to see that support for your preferred compiler
  804. is available.
  805. The app also seemed to port to the Sparc OK, although I didn't see the
  806. completion of that effort.
  807.  
  808. Overall, I was happy with the decision to use Neuron Data, although
  809. for certain types of projects I might choose something else. For
  810. example, I'm now doing Windows and NT development that does not have
  811. to be portable, and Borland's Delphi is a great environment for this.
  812.  
  813.  
  814. I left the company where I was using ND, so I'm not sure what the
  815. current state is. However, I have a friend at another company who was
  816. using Neuron Data, and abandoned it, as he needed support for a
  817. Windows 95 look-and-feel, and ND wasn't planning to provide one in the
  818. near-term. If this is important to you, I recommend quizzing them
  819. about delivery schedules (and taking them with a grain of salt, as
  820. they were late on the C++ support)
  821.  
  822. Well, if you made it through all that, I also have a brief comment on
  823. Zinc and zApp. I thought they were both poorly structured (in C++
  824. class hierarchy terms), and that their interface builders were also
  825. terrible. They have probably improved some by now, though.
  826.  
  827. If you have any questions, let me know.
  828.  
  829.                 Brett
  830.  
  831.  
  832. --
  833. Brett Kuehner
  834. bvk@chelsea.ios.com
  835.  
  836.  
  837. +++++++++++++++++++++++++++
  838.  
  839. >From adt@netcom.com (Anthony D. Tribelli)
  840. Date: Mon, 20 Nov 1995 18:25:59 GMT
  841. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  842.  
  843. Gerbert Orasche (gorasche@iicm.tu-graz.ac.at) wrote:
  844. : I am cross-developing for Windows 3.x,95,NT,Mac, and PowerMac using 
  845. : Microsofts tools...
  846. : ... It works quite fine (full MFC support), 
  847. : but I do not now very much about performance yet.
  848.  
  849. I recently used MSVC++ for Mac 2.0 (I haven't received 4.0 yet) to create 
  850. a simple 3D molecular visualization program. As you say, MFC was 
  851. supported very well. The rendering performance of my program was poor 
  852. compared to our native Mac applications (built with Metrowerks 
  853. CodeWarrior). By using conditional compilation I was able to get my 
  854. program to run 2.5 TIMES FASTER. It now runs at a speed equivalent to our 
  855. native Mac applications.
  856.  
  857. The changes were relatively trivial. I replaced two Windows GDI calls with
  858. Apple QuickDraw calls: Ellipse and Polygon => PaintOval and PaintPoly. I 
  859. also removed some unneccessary Windows GDI calls from Mac builds: 
  860. CreatePen, CreateBrush, SelectObject.
  861.  
  862. Tony
  863.  
  864. -- 
  865. - ----------------
  866. Tony Tribelli
  867. adtribelli@acm.org
  868.  
  869. +++++++++++++++++++++++++++
  870.  
  871. >From jdowning@ccmail.gsfc.nasa.gov (John Downing)
  872. Date: Mon, 27 Nov 1995 09:34:09
  873. Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
  874.  
  875. In article <adtDICtvB.D8G@netcom.com> adt@netcom.com (Anthony D. Tribelli) writes:
  876. >From: adt@netcom.com (Anthony D. Tribelli)
  877. >Subject: Re: Experience with Zinc/Galaxy/Neuron Data?
  878. >Date: Mon, 20 Nov 1995 18:25:59 GMT
  879.  
  880. >Gerbert Orasche (gorasche@iicm.tu-graz.ac.at) wrote:
  881. >: I am cross-developing for Windows 3.x,95,NT,Mac, and PowerMac using 
  882. >: Microsofts tools...
  883. >: ... It works quite fine (full MFC support), 
  884. >: but I do not now very much about performance yet.
  885.  
  886. >I recently used MSVC++ for Mac 2.0 (I haven't received 4.0 yet) to create 
  887. >a simple 3D molecular visualization program. As you say, MFC was 
  888. >supported very well. The rendering performance of my program was poor 
  889. >compared to our native Mac applications (built with Metrowerks 
  890. >CodeWarrior). By using conditional compilation I was able to get my 
  891. >program to run 2.5 TIMES FASTER. It now runs at a speed equivalent to our 
  892. >native Mac applications.
  893.  
  894. >The changes were relatively trivial. I replaced two Windows GDI calls with
  895. >Apple QuickDraw calls: Ellipse and Polygon => PaintOval and PaintPoly. I 
  896. >also removed some unneccessary Windows GDI calls from Mac builds: 
  897. >CreatePen, CreateBrush, SelectObject.
  898.  
  899. Doesn't this sort of defeat the purpose?
  900.  
  901. ---------------------------
  902.  
  903. >From quinlan@news.sfu.ca (Brian Quinlan)
  904. Subject: Floating menus sink my dialogs
  905. Date: 22 Nov 1995 20:09:35 GMT
  906. Organization: Simon Fraser University
  907.  
  908. I just finished writting some code to handling floating windows. It works
  909. my using the low-level window manager routines. My problem is that
  910. the dialog manager seems to check to see if it is the front window during
  911. DialogSelect and IsDialogEvent.  It occured to me that I could use two 
  912. strategies to overcome this problem. First I could patch FrontWindow( ) and 
  913. hope that that's what those routines use. Second I could fudge the window
  914. list just before calling those routines to make the dialog appear to be
  915. the front window. What should I do? Is there a third and more elegant
  916. technique?
  917.  
  918. --
  919.  
  920. Brian Quinlan
  921. quinlan@sfu.ca
  922.  
  923. +++++++++++++++++++++++++++
  924.  
  925. >From dejal@iconz.co.nz (David Sinclair)
  926. Date: 23 Nov 1995 20:16:10 GMT
  927. Organization: iconz, Auckland, New Zealand
  928.  
  929. Brian Quinlan (quinlan@news.sfu.ca) wrote:
  930. : I just finished writting some code to handling floating windows. It works
  931. : my using the low-level window manager routines. My problem is that
  932. : the dialog manager seems to check to see if it is the front window during
  933. : DialogSelect and IsDialogEvent.  It occured to me that I could use two 
  934. : strategies to overcome this problem. First I could patch FrontWindow( ) and 
  935. : hope that that's what those routines use. Second I could fudge the window
  936. : list just before calling those routines to make the dialog appear to be
  937. : the front window. What should I do? Is there a third and more elegant
  938. : technique?
  939.  
  940. I was struggling with this very same issue just earlier this week, 
  941. including discussing it with the author of the Infinity Windoid and others.
  942.  
  943. My solution was to use the GhostWindow low-mem global: it prevents 
  944. FrontWindow from returning a floating window as frontmost.  It works, but 
  945. the problem is that it only allows you to have one floating window.  
  946. That's fine for me, but if you need more, I'd suggest fiddling with the 
  947. window list (or rather, replace the WindowList low-mem global with the 
  948. window you want to consider frontmost, then restore the old value 
  949. afterwards.  I haven't tried using this method, but it should work.
  950.  
  951. Personally, I consider manipulating documented low-mem globals to be 
  952. better than patching routines -- less likely to cause compatibility 
  953. problems.
  954.  
  955. Good luck!  (And if you do find some better technique, please let me know.)
  956.  
  957. David Sinclair
  958. Dejal Userware
  959.  
  960. --
  961.  
  962. |\  ._   .  _  .     Dejal Userware  |  dejal@pobox.com  (preferred)
  963. | | |_   | |_| |     PO Box 33-1011  |  dejal@iconz.co.nz, dejal@amug.org
  964. |/  |_ \_| | | |_    Takapuna        |  dejal@netgate.co.nz (avail shortly)
  965. - ---------------    Auckland 1309   |  100033.2435@compuserve.com
  966.  U S E R W A R E     New Zealand     |  ftp://ftp.amug.org/pub/contrib/dejal/
  967. - ---------------                    |  http://pobox.com/~dejal/
  968.  
  969. Author of SndConverter Pro, SndPlayer, QuickEncrypt, TextMerge, TextSplitter
  970. and other Shareware and Freeware products for the Macintosh.
  971.  
  972. +++++++++++++++++++++++++++
  973.  
  974. >From cameron_esfahani@powertalk.apple.com (Cameron Esfahani)
  975. Date: Thu, 23 Nov 1995 18:51:23 -0800
  976. Organization: Apple Computer, Inc.
  977.  
  978. If I could make a suggestion.  Why don't you consider using Dean Yu's
  979. Floating Window code.  It doesn't patch anything or mess with any
  980. lowmems.  It was introduced in Develop 15 in an article with sample code. 
  981. The latest developer CD would have the latest and greatest version of the
  982. code.  Most people that I know who do floating windows use this code.
  983.  
  984. Cameron Esfahani
  985.  
  986. +++++++++++++++++++++++++++
  987.  
  988. >From dejal@iconz.co.nz (David Sinclair)
  989. Date: 24 Nov 1995 06:22:49 GMT
  990. Organization: iconz, Auckland, New Zealand
  991.  
  992. Cameron Esfahani (cameron_esfahani@powertalk.apple.com) wrote:
  993. : If I could make a suggestion.  Why don't you consider using Dean Yu's
  994. : Floating Window code.  It doesn't patch anything or mess with any
  995. : lowmems.  It was introduced in Develop 15 in an article with sample code. 
  996. : The latest developer CD would have the latest and greatest version of the
  997. : code.  Most people that I know who do floating windows use this code.
  998.  
  999. Simple -- because it doesn't support modeless dialogs in the way I (and 
  1000. presumably the original poster) need.  The program I'm working on (5Mb of 
  1001. source code!) uses modeless dialogs all over the place as normal windows 
  1002. (since it needs lots of entry fields, well suited to the Dialog Manager).
  1003. The way the Develop 15 code works is to treat modeless dialogs as modal, 
  1004. and bring them up in front of the floating window(s), which is no good 
  1005. for me.
  1006.  
  1007. The problem is that IsDialogEvent and DialogSelect both call FrontWindow 
  1008. internally, which breaks the Develop 15 code if a modeless dialog is to 
  1009. be treated as a normal window.  Only by using ghostWindow or fiddling 
  1010. with the window list can that be avoided, unfortunately.
  1011.  
  1012. Regards,
  1013.  
  1014. David Sinclair
  1015. Dejal Userware
  1016.  
  1017. --
  1018.  
  1019. |\  ._   .  _  .     Dejal Userware  |  dejal@pobox.com  (preferred)
  1020. | | |_   | |_| |     PO Box 33-1011  |  dejal@iconz.co.nz, dejal@amug.org
  1021. |/  |_ \_| | | |_    Takapuna        |  dejal@netgate.co.nz (avail shortly)
  1022. - ---------------    Auckland 1309   |  100033.2435@compuserve.com
  1023.  U S E R W A R E     New Zealand     |  ftp://ftp.amug.org/pub/contrib/dejal/
  1024. - ---------------                    |  http://pobox.com/~dejal/
  1025.  
  1026. Author of SndConverter Pro, SndPlayer, QuickEncrypt, TextMerge, TextSplitter
  1027. and other Shareware and Freeware products for the Macintosh.
  1028.  
  1029.  
  1030. +++++++++++++++++++++++++++
  1031.  
  1032. >From mouser@zercom.net (Martin-Gilles Lavoie)
  1033. Date: Sat, 25 Nov 1995 10:17:13 -0500
  1034. Organization: ZERCOM Technologies Inc.
  1035.  
  1036. In article <49001v$29b@morgoth.sfu.ca>, quinlan@news.sfu.ca (Brian
  1037. Quinlan) wrote:
  1038.  
  1039. > I just finished writting some code to handling floating windows. It works
  1040. > my using the low-level window manager routines. My problem is that
  1041. > the dialog manager seems to check to see if it is the front window during
  1042. > DialogSelect and IsDialogEvent.  It occured to me that I could use two 
  1043. > strategies to overcome this problem. First I could patch FrontWindow( ) and 
  1044. > hope that that's what those routines use. Second I could fudge the window
  1045. > list just before calling those routines to make the dialog appear to be
  1046.  
  1047.  
  1048. > the front window. What should I do? Is there a third and more elegant
  1049. > technique?
  1050.  
  1051. Yes: rewrite the dialog manager.
  1052.  
  1053. No kidding, it's essentially what I did.  I was using the WindowsExtension.h/.c
  1054.  library as found and documented in Develop (and also available womewhere
  1055. in ftp.apple.com, I think), but found that it didn't support dialog-based
  1056. floaters, and that the Dialog Manager didn't support floaters.  I reworked
  1057. the WindowsExtensions lib to use a different "windowKind" variable
  1058. ("myWindowKind", to be more exact and original..), and for that lib to use
  1059. DialogRecords instead of WindowRecords (plain windows take a little more
  1060. mem, but the tradeoff is acceptable).  Then, I wrote "DialogSelect" and
  1061. "IsDialogEvent" equivalents to replace the dialog manager.  This is
  1062. simple, and I beleive I have posted the code a while ago.  (I then whent
  1063. on to rewrite DrawDialog to support unlimited font/size/face/justification
  1064. and a bunch other cool thing, like drag-and-drop, colored background in
  1065. stat text, cursor management, etc).
  1066.  
  1067. HEY APPLE!  IF YOU WANT A NATIVE DIALOG MANAGER, I MOSTLY HAVE IT!!!!
  1068.  
  1069. Just teasing.
  1070.  
  1071. MGL
  1072.  
  1073. Martin-Gilles Lavoie
  1074. - -------------------------------------------------------------------
  1075. No!...try not.  Do, or do not.  There is no try.
  1076.     --Yoda on error handling.
  1077.  
  1078. Wars does not make one great.
  1079.     --Yoda on "Great Warrior"
  1080.  
  1081. +++++++++++++++++++++++++++
  1082.  
  1083. >From pottier@drakkar.ens.fr (Francois Pottier)
  1084. Date: 26 Nov 1995 20:13:09 GMT
  1085. Organization: Ecole Normale Superieure, Paris
  1086.  
  1087. In article <mouser-2511951017130001@204.191.6.123>,
  1088. Martin-Gilles Lavoie <mouser@zercom.net> wrote:
  1089.  
  1090. >HEY APPLE!  IF YOU WANT A NATIVE DIALOG MANAGER, I MOSTLY HAVE IT!!!!
  1091.  
  1092. They don't - it's going away with Copland.
  1093.  
  1094. Seriously though, you're right, bypassing the Dialog Manager is the
  1095. right way. That's the way PowerPlant does floating windows, for
  1096. instance. It never uses a single dialog.
  1097.  
  1098.  
  1099.  
  1100. -- 
  1101. Francois
  1102. pottier@dmi.ens.fr
  1103. http://www.eleves.ens.fr:8080/home/pottier/
  1104.  
  1105. +++++++++++++++++++++++++++
  1106.  
  1107. >From reed@medicine.wustl.edu (Thomas Reed)
  1108. Date: Mon, 27 Nov 1995 11:14:29 -0600
  1109. Organization: Washington University
  1110.  
  1111. In article <49001v$29b@morgoth.sfu.ca>, quinlan@news.sfu.ca (Brian
  1112. Quinlan) wrote:
  1113.  
  1114. >I just finished writting some code to handling floating windows. It works
  1115. >my using the low-level window manager routines. My problem is that
  1116. >the dialog manager seems to check to see if it is the front window during
  1117. >DialogSelect and IsDialogEvent.
  1118.  
  1119. I've heard many people say they've had this problem -- I don't know what
  1120. the cause is, but my floating windows work perfectly and don't have this
  1121. problem.  Get hold of a copy of Matt Slot's appe Windows code.  That's
  1122. what my floaters are based on, and it's very easy to reuse.
  1123.  
  1124. -Thomas
  1125.  
  1126. =====================================================
  1127. Thomas Reed                     Washington University
  1128. reed@visar.wustl.edu               Medical School
  1129. reed@medicine.wustl.edu            Saint Louis, MO
  1130. http://medinfo.wustl.edu/~reed
  1131. - ---------------------------------------------------
  1132. Clothes make the man.  Naked people have little or no
  1133. influence on society.  -- Mark Twain
  1134. =====================================================
  1135.  
  1136. Opinions posted are not the opinions of Wash. U.
  1137.  
  1138. ---------------------------
  1139.  
  1140. >From julian@cs.auckland.ac.nz (Julian Harris)
  1141. Subject: GetAppFiles - link error?
  1142. Date: Thu, 23 Nov 1995 23:51:36 +0100
  1143. Organization: Computer Science, The University of Auckland
  1144.  
  1145. Hi all. 
  1146.  
  1147. I'm compiling this rather old source that has references to _GetAppFiles_
  1148. and _CountAppFiles_.
  1149.  
  1150. I want this program to work under System 6 _and_ PowerMac so does anyone
  1151. know where these traps have disappeared to?
  1152.  
  1153. TIA.
  1154.  
  1155. -- 
  1156. .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
  1157. Microsoft is not the answer.                    >  Julian Harris, Programmer   >
  1158. Microsoft is the question.                     >  Comp. Sci. Dept.     x8915  >
  1159.                                               >  The University of Auckland  >
  1160. NO is the answer.                            >  julian@cs.auckland.ac.nz    >
  1161.  
  1162. +++++++++++++++++++++++++++
  1163.  
  1164. >From plau@twirl.io.org (Peter S. Lau)
  1165. Date: 23 Nov 1995 15:34:06 GMT
  1166. Organization: Internex Online, Toronto, Ontario, Canada (416 363 3783)
  1167.  
  1168. In article <julian-2311952351360001@julian.cs.auckland.ac.nz> julian@cs.auckland.ac.nz (Julian Harris) writes:
  1169.  
  1170. >I'm compiling this rather old source that has references to _GetAppFiles_
  1171. >and _CountAppFiles_.
  1172. >
  1173. >I want this program to work under System 6 _and_ PowerMac so does anyone
  1174. >know where these traps have disappeared to?
  1175.  
  1176. A quick solution is to open SegLoad.h and copy those funtion
  1177. declarations into your file where GetAppFiles() resides... if you look
  1178. at SegLoad.h, it's excluded when compiling ppc...
  1179.  
  1180. Not sure what will happen in the future...
  1181.  
  1182. pete
  1183.  
  1184.  
  1185. +++++++++++++++++++++++++++
  1186.  
  1187. >From jwbaxter@olympus.net (John W. Baxter)
  1188. Date: Thu, 23 Nov 1995 13:13:48 -0800
  1189. Organization: Townsend Communications
  1190.  
  1191. In article <julian-2311952351360001@julian.cs.auckland.ac.nz>,
  1192. julian@cs.auckland.ac.nz (Julian Harris) wrote:
  1193.  
  1194. > Hi all. 
  1195. > I'm compiling this rather old source that has references to _GetAppFiles_
  1196. > and _CountAppFiles_.
  1197. > I want this program to work under System 6 _and_ PowerMac so does anyone
  1198. > know where these traps have disappeared to?
  1199.  
  1200. It's time to redo the app to support the "required events".  Copy the
  1201. source out of Inside Mac: IAC.  Or any modern sample app.
  1202.  
  1203.    --John
  1204.  
  1205. -- 
  1206.   "This item is not available because it cannot be removed."
  1207. John W. Baxter    Port Ludlow, WA     jwbaxter@olympus.net
  1208.  
  1209. +++++++++++++++++++++++++++
  1210.  
  1211. >From pottier@goelette.ens.fr (Francois Pottier)
  1212. Date: 24 Nov 1995 14:08:34 GMT
  1213. Organization: Ecole Normale Superieure, Paris
  1214.  
  1215. In article <julian-2311952351360001@julian.cs.auckland.ac.nz>,
  1216.  
  1217. >I want this program to work under System 6 _and_ PowerMac so does anyone
  1218. >know where these traps have disappeared to?
  1219.  
  1220. To the bit bucket. These calls *do not exist* on Power Macs.
  1221.  
  1222. -- 
  1223. Francois
  1224. pottier@dmi.ens.fr
  1225. http://www.eleves.ens.fr:8080/home/pottier/
  1226.  
  1227. +++++++++++++++++++++++++++
  1228.  
  1229. >From phixus@deltanet.com (Chris De Salvo)
  1230. Date: Mon, 27 Nov 1995 03:00:40 -0800
  1231. Organization: MacPlay
  1232.  
  1233. In article <julian-2311952351360001@julian.cs.auckland.ac.nz>,
  1234. julian@cs.auckland.ac.nz (Julian Harris) wrote:
  1235.  
  1236. >I'm compiling this rather old source that has references to _GetAppFiles_
  1237. >and _CountAppFiles_.
  1238. >
  1239. >I want this program to work under System 6 _and_ PowerMac so does anyone
  1240. >know where these traps have disappeared to?
  1241.  
  1242. That mechanism does not exist under the PowerPC version of the system
  1243. software.  You'll need to install AppleEvent handlers for the 'odoc' (open
  1244. document) event.
  1245.  
  1246. Do you really NEED to support System 6?  Not many copiesof that still in use.
  1247.  
  1248. L8R
  1249. Chris
  1250.  
  1251. -- 
  1252. phixus@deltanet.com         |   Macintosh:  Changing the world,
  1253. Chris De Salvo              |        one person at a time!
  1254. Professional Mac Geek       |    -----------------------------
  1255. for MacPlay, Inc.           |      (I wish they'd hurry up!)
  1256.  
  1257.            http://www.deltanet.com/users/phixus
  1258.  
  1259. ---------------------------
  1260.  
  1261. >From Anders.Wahlin@hum.gu.se (Anders Wahlin)
  1262. Subject: How to get a folder's volume information!
  1263. Date: Tue, 21 Nov 1995 14:32:06 GMT
  1264. Organization: Hum Fak:s Dataservice
  1265.  
  1266. In my program I let the user select a folder (using CustomGetFolder). Then
  1267. the program will get the FSSpec of that folder and then it will store it
  1268. in an 'alis'-resource. Now, if that folder is located on an AppleShare
  1269. volume, the user has to enter his/hers user name and password to have
  1270. access to it the next time.
  1271.  
  1272. I know how most of this is done except for:
  1273.  
  1274. * How can I determine a volume's zoneName and serverName from a folder's FSSpec
  1275. * How do I know that the selected folder (FSSpec) is located on an
  1276. AppleShare volume.
  1277.  
  1278. I'd really appreciate all kind of help!
  1279.  
  1280. Many thanks
  1281.  
  1282. -- 
  1283. Anders Wahlin
  1284. Anders.Wahlin@hum.gu.se
  1285.  
  1286. +++++++++++++++++++++++++++
  1287.  
  1288. >From mclow@mailhost2.csusm.edu (Marshall Clow)
  1289. Date: Thu, 23 Nov 1995 00:55:49 -0800
  1290. Organization: Aladdin Systems
  1291.  
  1292. In article <Anders.Wahlin-2111951632060001@bigmac.hum.gu.se>,
  1293. Anders.Wahlin@hum.gu.se (Anders Wahlin) wrote:
  1294.  
  1295. >In my program I let the user select a folder (using CustomGetFolder). Then
  1296. >the program will get the FSSpec of that folder and then it will store it
  1297. >in an 'alis'-resource. Now, if that folder is located on an AppleShare
  1298. >volume, the user has to enter his/hers user name and password to have
  1299. >access to it the next time.
  1300. >
  1301. >I know how most of this is done except for:
  1302. >
  1303. >* How can I determine a volume's zoneName and serverName from a folder's FSSpec
  1304. >
  1305. Call PBHGetVolMountInfo.
  1306.  
  1307. >* How do I know that the selected folder (FSSpec) is located on an
  1308. >AppleShare volume.
  1309. >
  1310. Telling if a drive is local or remote is easy; call PBHGetVolParms and
  1311. check to see if buffer.vMServerAdr != 0.
  1312.  
  1313. BTW, use the vRefNum in the FSSpec to refer to the correct volume.
  1314.  
  1315. -- 
  1316. Marshall Clow
  1317. Aladdin Systems
  1318.  
  1319. "They that can give up essential liberty to obtain a little temporary
  1320.  safety deserve neither liberty nor safety." -- Benjamin Franklin
  1321.  _Historical Review of Pennsylvania_, 1759
  1322.  
  1323. +++++++++++++++++++++++++++
  1324.  
  1325. >From jumplong@aol.com (Jump Long)
  1326. Date: 23 Nov 1995 06:05:09 -0500
  1327. Organization: America Online, Inc. (1-800-827-6364)
  1328.  
  1329. Anders Wahlin wrote:
  1330. >In my program I let the user select a folder (using
  1331. >CustomGetFolder). Then the program will get the FSSpec of that
  1332. >folder and then it will store it in an 'alis'-resource. Now, if
  1333. >that folder is located on an AppleShare volume, the user has to
  1334. >enter his/hers user name and password to have access to it the
  1335. >next time.
  1336. >
  1337. >I know how most of this is done except for:
  1338. >
  1339. >* How can I determine a volume's zoneName and serverName from a
  1340. >folder's FSSpec * How do I know that the selected folder
  1341. >(FSSpec) is located on an AppleShare volume.
  1342. >
  1343. >I'd really appreciate all kind of help!
  1344.  
  1345. You seem to be a little confused...
  1346.  
  1347. Let's say you get an FSSpec to a folder from your CustomGetFolder routine.
  1348. If you want to store that location for later use, you should create an
  1349. alias to the folder by passing the FSSpec to NewAlias. NewAlias will
  1350. create an AliasHandle that contains the alias record. The alias record
  1351. contains everything needed to find that folder later. You can then add the
  1352. AliasHandle to a resource file as an 'alis' resource.
  1353.  
  1354. Later, when you need to find the folder, get the 'alis' resource and pass
  1355. that resource handle to ResolveAlias. ResolveAlias (if successful) will
  1356. return an FSSpec to the folder and it needed, will take care of any user
  1357. interface needed to mount the volume the folder is on.
  1358.  
  1359. Going back to your question:
  1360. >* How can I determine a volume's zoneName and serverName from a
  1361. >folder's FSSpec * How do I know that the selected folder
  1362. >(FSSpec) is located on an AppleShare volume.
  1363.  
  1364. You can get that information the same way the Alias Manager gets it - call
  1365. PBGetVolMountInfoSize and PBGetVolMountInfo. If PBGetVolMountInfoSize and
  1366. PBGetVolMountInfo return paramErr (-50), it means that the volume doesn't
  1367. support those calls. If they return noErr (0), it might be an AppleShare
  1368. volume. You can check the media field of the VolMountInfo record returned
  1369. by PBGetVolMountInfo to get the type of volume - 'afpm' is what you'll get
  1370. for AppleShare volumes.
  1371.  
  1372. - Jim Luther
  1373.  
  1374. ---------------------------
  1375.  
  1376. >From jmaling@ozemail.com.au (John Maling)
  1377. Subject: Random number seed dreaming.
  1378. Date: 12 Nov 1995 19:48:55 GMT
  1379. Organization: Zip Nada and Zero
  1380.  
  1381. OK, this must be a weird one, it came to me in a dream. I know that the
  1382. random number generator is pseudo-random, that if you initilise it with
  1383. the same number you get the same result sequence. So, could this be used
  1384. to play back an identical sequence of pseudo-random events inside a game
  1385. reguardless of the individual Mac the game runs on? Or does the random
  1386. number generator on each Mac produce different values even if the seed is
  1387. the same?
  1388.  
  1389. I need to create a record of complex game events to be sent to certain
  1390. players, events which are themselves independant of player input. So if
  1391. the ramdom seed produced the same result on every Mac then I would only
  1392. need to pass the seed, and use it to reproduce the event sequence, rather
  1393. than send the entire event sequence.
  1394.  
  1395. From: jmaling@ozemail.com.au
  1396.  
  1397. +++++++++++++++++++++++++++
  1398.  
  1399. >From jmunkki@beta.hut.fi (Juri Munkki)
  1400. Date: 13 Nov 1995 03:28:25 GMT
  1401. Organization: Helsinki University of Technology
  1402.  
  1403. In article <jmaling-1311950652250001@slwol1p24.ozemail.com.au> jmaling@ozemail.com.au (John Maling) writes:
  1404. >OK, this must be a weird one, it came to me in a dream. I know that the
  1405. >random number generator is pseudo-random, that if you initilise it with
  1406. >the same number you get the same result sequence. So, could this be used
  1407. >to play back an identical sequence of pseudo-random events inside a game
  1408. >reguardless of the individual Mac the game runs on? Or does the random
  1409. >number generator on each Mac produce different values even if the seed is
  1410. >the same?
  1411.  
  1412. I think all Macs use the same algorithm for Random, but you shouldn't
  1413. trust in this. If you need a repeatable set of pseudorandom numbers,
  1414. you should use your own version of Random.
  1415.  
  1416. Books on computer algorithms usually have a chapter on pseudorandom
  1417. number generation.
  1418.  
  1419. >I need to create a record of complex game events to be sent to certain
  1420. >players, events which are themselves independant of player input. So if
  1421. >the ramdom seed produced the same result on every Mac then I would only
  1422. >need to pass the seed, and use it to reproduce the event sequence, rather
  1423. >than send the entire event sequence.
  1424.  
  1425. Arashi uses two random generators: one is used for visual effects and
  1426. stuff that doesn't affect the game engine. The other one is used for
  1427. internal stuff. It plays back saved games when it is idle. The saved
  1428. games consist of the random seed and only a few bits of information per
  1429. frame: movement and shoot+zap flags. This means that it takes only 20
  1430. bytes/second (or 72 KB/hour) to save games.
  1431.  
  1432. Marathon saves films this way, but I don't know how much randomness they
  1433. have in the game. In many cases random numbers are not necessary in games,
  1434. because player actions are different enough every time, so they could
  1435. actually probably write the whole game without using a single random number...
  1436.  
  1437. -- 
  1438. Juri Munkki jmunkki@iki.fi      There ain't no such thing as a shareware lunch.
  1439. http://www.iki.fi/~jmunkki              Windsurfing: Faster than the wind.
  1440.  
  1441. +++++++++++++++++++++++++++
  1442.  
  1443. >From dwareing@adelaide.on.net (David Wareing)
  1444. Date: Tue, 21 Nov 1995 14:18:31 +1100
  1445. Organization: Weyland Yutani
  1446.  
  1447. In article <jmaling-1311950652250001@slwol1p24.ozemail.com.au>,
  1448. jmaling@ozemail.com.au (John Maling) wrote:
  1449.  
  1450. >OK, this must be a weird one, it came to me in a dream. I know that the
  1451. >random number generator is pseudo-random, that if you initilise it with
  1452. >the same number you get the same result sequence. So, could this be used
  1453. >to play back an identical sequence of pseudo-random events inside a game
  1454. >reguardless of the individual Mac the game runs on? Or does the random
  1455. >number generator on each Mac produce different values even if the seed is
  1456. >the same?
  1457.  
  1458. I'd think that it would produce the same value on any Mac, but I guess it
  1459. would depend upon whether _Random has changed between System releases
  1460. and whether or not the PPC version is different from the 68K code.
  1461.  
  1462. As Juri Munkki pointed out recently, it'd be safer to write your own
  1463. Random function and use that for all seeding. Do a search through the
  1464. csmp digests for dozens of articles on rolling your own Random function.
  1465.  
  1466. -- 
  1467. David Wareing                                 dwareing@adelaide.on.net
  1468. Belair, South Australia           http://www.AmbrosiaSW.com/~dwareing/
  1469. Macintosh Games & Multimedia Programming
  1470.  
  1471.  
  1472. +++++++++++++++++++++++++++
  1473.  
  1474. >From pottier@goelette.ens.fr (Francois Pottier)
  1475. Date: 24 Nov 1995 13:31:47 GMT
  1476. Organization: Ecole Normale Superieure, Paris
  1477.  
  1478. In article <dwareing-2111951418310001@ppp132.adelaide.on.net.au>,
  1479. David Wareing <dwareing@adelaide.on.net> wrote:
  1480.  
  1481. >I'd think that it would produce the same value on any Mac, but I guess it
  1482. >would depend upon whether _Random has changed between System releases
  1483. >and whether or not the PPC version is different from the 68K code.
  1484.  
  1485. This has been discussed before, and someone from Apple said that they
  1486. were tempted to change the algorithm when rewriting Random() for
  1487. PowerPC, but they didn't because some applications relied on it. So I
  1488. guess it would be safe to assume it will never change. Look in the
  1489. digests for this thread.
  1490.  
  1491.  
  1492. -- 
  1493. Francois
  1494. pottier@dmi.ens.fr
  1495. http://www.eleves.ens.fr:8080/home/pottier/
  1496.  
  1497. ---------------------------
  1498.  
  1499. >From gordon@micron.net (Gordon Henriksen)
  1500. Subject: SAT 2.3.5 is out!
  1501. Date: 22 Nov 1995 03:14:23 GMT
  1502. Organization: Micron Internet Services
  1503.  
  1504. Doesn't the subject say it all?
  1505.  
  1506. ftp://mirrors.aol.com/pub/info-mac/rec/sprite-anim-kit-235.hqx
  1507.  
  1508.                       TTFN,
  1509.                         Gordon Henriksen
  1510.                         gordon@micron.net
  1511.                  _________________________________
  1512.                  Q: Where do you want to go today?
  1513.                      A: Anywhere but Chicago!
  1514. __________________________________________________________________
  1515. Microsoft Network is prohibited from redistributing this work in
  1516. any form, in whole or in part. Copyright, Gordon Henriksen, 1995.
  1517. License to distribute this post is available to Microsoft for $150.
  1518. Posting without permission constitutes an agreement to these terms.
  1519. Please send notices of violation to gordon@micron.net and 
  1520. Postmaster@microsoft.com
  1521.  
  1522. +++++++++++++++++++++++++++
  1523.  
  1524. >From ingemar@lysator.liu.se (Ingemar Ragnemalm)
  1525. Date: 24 Nov 1995 17:01:09 GMT
  1526. Organization: (none)
  1527.  
  1528. gordon@micron.net (Gordon Henriksen) writes:
  1529.  
  1530. >Doesn't the subject say it all?
  1531.  
  1532. >ftp://mirrors.aol.com/pub/info-mac/rec/sprite-anim-kit-235.hqx
  1533.  
  1534. Thanks! :-) It is strange - my announcements seem not to have shown up yet.
  1535.  
  1536. There is a little more to say, like that this is the first version that I
  1537. have successfully used with the PPC version of SC++ (though I would recommend
  1538. some other compiler to anyone with less than 20-30 megs of RAM). Also, it
  1539. comes in two parts nowadays. The demo programs are in a separate archive.
  1540.  
  1541. There is a bug fix coming up too, as mentioned in another thread.
  1542. It is already available at Lysator (ftp.lysator.liu.se) and should show
  1543. up at Info-Mac and Umich very soon.
  1544.  
  1545. --
  1546. - -
  1547. Ingemar Ragnemalm, PhD
  1548. Image processing, Mac shareware games
  1549. E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  1550.  
  1551. ---------------------------
  1552.  
  1553. >From 1goertz@informatik.uni-hamburg.de (Thorsten Goertz)
  1554. Subject: Where to store the sprite-graphics?
  1555. Date: 20 Nov 1995 15:32:45 GMT
  1556. Organization: University of Hamburg -- Germany
  1557.  
  1558. I'm currently writing a program that has to display some
  1559. large picts in 256 colors and animates some smaller picts
  1560. as sprites on the screen.
  1561. The picts are stored in the resource-fork. Reading and
  1562. copying them to an offscreen-GWorld is very slow!
  1563. What is the preffered way for storing and reading the
  1564. graphics without waiting 10-15 seconds (at least on
  1565. my LC475) before the animation starts?
  1566.  
  1567. +++++++++++++++++++++++++++
  1568.  
  1569. >From chrisman@ucdmath.ucdavis.edu (Mark Chrisman)
  1570. Date: Mon, 20 Nov 1995 17:03:30 -0800
  1571. Organization: Inreach's InterNetNews Site
  1572.  
  1573. In article <48q72t$mcn@rzsun02.rrz.uni-hamburg.de>,
  1574. 1goertz@informatik.uni-hamburg.de (Thorsten Goertz) wrote:
  1575.  
  1576. |I'm currently writing a program that has to display some
  1577. |large picts in 256 colors and animates some smaller picts
  1578. |as sprites on the screen.
  1579. |The picts are stored in the resource-fork. Reading and
  1580. |copying them to an offscreen-GWorld is very slow!
  1581. |What is the preffered way for storing and reading the
  1582. |graphics without waiting 10-15 seconds (at least on
  1583. |my LC475) before the animation starts?
  1584.  
  1585. One thing to remember (and this goes for all programs, not just games) is
  1586. that it doesn't have to *be* fast.  It just has to *seem* fast.  There are
  1587. several ways to increase the apparent speed of your startup (even if you
  1588. can't figure out how to increase the actual speed).
  1589.  
  1590. 1.  Display some nice graphics.  Look at Arashi.  The opening graphics are
  1591. so cool that the user doesn't mind watching.  While the graphics are being
  1592. displayed---as long as they're not too processor intensive---you can do
  1593. your initialization (load sprites & sounds, etc.).
  1594.  
  1595. 2.  Display a progress bar.  This does a lot to alleviate user
  1596. frustration.  The user knows that the time isn't being wasted, that some
  1597. necessary startup stuff is being done, and has some idea how long it's
  1598. going to take.  (Can you imaging waiting for Maelstrom to start, if it
  1599. didn't have a progress bar?)
  1600.  
  1601. 3.  Use menu bars and dialog boxes.  Many games start up as normal
  1602. Macintosh applications.  The user has to select "New Game" from the menu
  1603. or from a dialog box to start the game.  Don't waste this time!  You can
  1604. be loading graphics while waiting for menu or mouse events.  (If the user
  1605. selects "New Game" before you're done loading---well, at least you got
  1606. *some* of it done.)
  1607.  
  1608. 4.  Use between-level screens.  ("Prepare for level 1".)  While the user
  1609. is preparing for level 1, you can also be preparing!  This is also a good
  1610. time to generate a bunch of random numbers in advance, or make other
  1611. necessary calculations.
  1612.  
  1613. -- 
  1614. Mark Chrisman
  1615. chrisman@ucdmath.ucdavis.edu
  1616.  
  1617. +++++++++++++++++++++++++++
  1618.  
  1619. >From first.ascent@mindlink.bc.ca (Alex Curylo)
  1620. Date: 21 Nov 1995 02:53:01 GMT
  1621. Organization: First Ascent
  1622.  
  1623. In article <48q72t$mcn@rzsun02.rrz.uni-hamburg.de>
  1624. 1goertz@informatik.uni-hamburg.de (Thorsten Goertz) writes:
  1625.  
  1626. > The picts are stored in the resource-fork. Reading and
  1627. > copying them to an offscreen-GWorld is very slow!
  1628.  
  1629. I hear you, brother. This adventure game I'm doing has the neighborhood
  1630. of 300 animation frames in some rooms. PICTs and GWorlds start to
  1631. become inconvenient in that neighborhood :)
  1632.  
  1633. > What is the preffered way for storing and reading the
  1634. > graphics without waiting 10-15 seconds (at least on
  1635. > my LC475) before the animation starts?
  1636.  
  1637. Encoding all the sprites for a room into a big data file as per the
  1638. scheme outlined in _Tricks of the Mac Game Programming Gurus_ is
  1639. working well enough for me. You read all the data in one big lump, a
  1640. nice bonus if you happen to be  playing off CD-ROM, and you just find
  1641. the offset of each sprite instead of going through that setting up the
  1642. GWorld stuff. Very convenient. Easier on the Memory Manager too ;)
  1643.  
  1644. Now, if someone would just post some optimized flipping and scaling
  1645. code for that encoder...
  1646.  
  1647.  
  1648. Alex Curylo  first.ascent@mindlink.bc.ca  (604)451-5323, fax -1359
  1649. ***  First Ascent: Mac programming, UP paragliders, indie CDs  ***
  1650.  
  1651. +++++++++++++++++++++++++++
  1652.  
  1653. >From jmunkki@beta.hut.fi (Juri Munkki)
  1654. Date: 22 Nov 1995 04:37:10 GMT
  1655. Organization: Helsinki University of Technology
  1656.  
  1657. In article <chrisman-2011951703300001@ppp036.inreach.com> chrisman@ucdmath.ucdavis.edu (Mark Chrisman) writes:
  1658. >1.  Display some nice graphics.  Look at Arashi.  The opening graphics are
  1659. >so cool that the user doesn't mind watching.  While the graphics are being
  1660. >displayed---as long as they're not too processor intensive---you can do
  1661. >your initialization (load sprites & sounds, etc.).
  1662.  
  1663. You must be talking about another game... Arashi doesn't really load much
  1664. more than the sounds and it doesn't display anything while it's doing that.
  1665. By the time the idle animations are running, everything has already been
  1666. loaded. Maybe you were thinking of Apeiron or Maelstrom.
  1667.  
  1668. -- 
  1669. Juri Munkki jmunkki@iki.fi      In cyberspace everyone can hear you scream.
  1670. http://www.iki.fi/~jmunkki              Windsurfing: Faster than the wind.
  1671.  
  1672. +++++++++++++++++++++++++++
  1673.  
  1674. >From ingemar@lysator.liu.se (Ingemar Ragnemalm)
  1675. Date: 24 Nov 1995 16:54:44 GMT
  1676. Organization: (none)
  1677.  
  1678. 1goertz@informatik.uni-hamburg.de (Thorsten Goertz) writes:
  1679.  
  1680. >I'm currently writing a program that has to display some
  1681. >large picts in 256 colors and animates some smaller picts
  1682. >as sprites on the screen.
  1683. >The picts are stored in the resource-fork. Reading and
  1684. >copying them to an offscreen-GWorld is very slow!
  1685. >What is the preffered way for storing and reading the
  1686. >graphics without waiting 10-15 seconds (at least on
  1687. >my LC475) before the animation starts?
  1688.  
  1689. Drawing pictures isn't very fast. If you only run in 256 colors and with
  1690. a specific color table, you can store the graphics as the pixel maps.
  1691.  
  1692. --
  1693. - -
  1694. Ingemar Ragnemalm, PhD
  1695. Image processing, Mac shareware games
  1696. E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  1697.  
  1698. +++++++++++++++++++++++++++
  1699.  
  1700. >From keeneybo@aol.com (KeeneyBo)
  1701. Date: 26 Nov 1995 20:32:42 -0500
  1702. Organization: America Online, Inc. (1-800-827-6364)
  1703.  
  1704. 1goertz@informatik.uni-hamburg.de (Thorsten Goertz) writes:
  1705.  
  1706. >I'm currently writing a program that has to display some
  1707. >large picts in 256 colors and animates some smaller picts
  1708. >as sprites on the screen.
  1709. >The picts are stored in the resource-fork. Reading and
  1710. >copying them to an offscreen-GWorld is very slow!
  1711. >What is the preffered way for storing and reading the
  1712. >graphics without waiting 10-15 seconds (at least on
  1713. >my LC475) before the animation starts?
  1714.  
  1715. Most games read pics and sprites into memory when the game is first
  1716. started up while the user is settling down to play the game.  In the many
  1717. games I've played over the years this method is common and not too
  1718. annoying.  Who cares if I have to wait 30 seconds for the game to
  1719. initialize?   As long as you don't continually dispose and reload the pics
  1720. I don't think you'll have a problem.
  1721.  
  1722. KeeneyBo@aol.com
  1723.  
  1724. ---------------------------
  1725.  
  1726. >From mtrent@msn.fullfeed.com (Michael Trent)
  1727. Subject: [Q] Color-Picker Popup Menu?
  1728. Date: Fri, 17 Nov 1995 00:02:31 -0500
  1729. Organization: FullFeed Madison (newsmaster@msn.fullfeed.com)
  1730.  
  1731. Here's a question I've been stewing over for some time:
  1732.  
  1733. I want to make a popup menu similar to the color pickers one finds in any
  1734. program w/ graphic capabilities. You know what I mean: Go to ResEdit (for
  1735. example), Edit a cicn, click on the color rectangles on the left side of
  1736. the edit window, and presto! a cool color menu appears from which you can
  1737. pick what color you want to plot.
  1738.  
  1739. Ok. I understand the MDEF. Not a problem. Actually, it was kind of fun!
  1740.  
  1741. The first problem is: I don't want a text title for my popup menu. I want
  1742. a framed rectangle containing the color selected from the menu. The second
  1743. problem is, I don't know how to do that.
  1744.  
  1745. I suppose I could fake it: just draw a rectangle and fill it with the
  1746. desired color. But then how would I get the menu to appear? Should the
  1747. popup be sitting near-by with a title width of 0? So many people implement
  1748. this thing, there has to be a "right way" to do it. Even so, I haven't
  1749. found any code examples to help me out.
  1750.  
  1751. I'd appreciate a hand in figuring this out. Thanks in advance! 
  1752.  
  1753. M Trent
  1754.  
  1755. -- 
  1756. >>SIG UNDER CONSTRUCTION<<
  1757.  
  1758. +++++++++++++++++++++++++++
  1759.  
  1760. >From rajadhyaksha.2@osu.edu (Ram Rajadhyaksha)
  1761. Date: Fri, 17 Nov 1995 12:39:12 -0500
  1762. Organization: The Ohio State University
  1763.  
  1764. In article <mtrent-1711950002310001@azathoth.msn.fullfeed.com>,
  1765. mtrent@msn.fullfeed.com (Michael Trent) wrote:
  1766.  
  1767. > I suppose I could fake it: just draw a rectangle and fill it with the
  1768. > desired color. But then how would I get the menu to appear? Should the
  1769. > popup be sitting near-by with a title width of 0? So many people implement
  1770. > this thing, there has to be a "right way" to do it. Even so, I haven't
  1771. > found any code examples to help me out.
  1772.  
  1773. Um, I haven't written an MDEF yet so I have limited knowledge about this
  1774. but, couldn't you just call PopUpMenuSelect? Draw the color box yourself
  1775. and call that trap when you have a mousedown in the area. It's the "old"
  1776. way of doing a pop-up menu and I think it's described in IM V.
  1777.  
  1778. I also think Apple distributes a sample source of this...
  1779.  
  1780. -Ram
  1781.  
  1782. +++++++++++++++++++++++++++
  1783.  
  1784. >From passenger@cybercom.net (Somebody Else)
  1785. Date: 18 Nov 1995 00:23:24 GMT
  1786. Organization: CYBERCOM Internet Services  (617) 396-0491
  1787.  
  1788. In article <mtrent-1711950002310001@azathoth.msn.fullfeed.com>,
  1789. mtrent@msn.fullfeed.com (Michael Trent) wrote:
  1790.  
  1791. > Here's a question I've been stewing over for some time:
  1792. > I want to make a popup menu similar to the color pickers one finds in any
  1793. > program w/ graphic capabilities. You know what I mean: Go to ResEdit (for
  1794. > example), Edit a cicn, click on the color rectangles on the left side of
  1795. > the edit window, and presto! a cool color menu appears from which you can
  1796. > pick what color you want to plot.
  1797. > Ok. I understand the MDEF. Not a problem. Actually, it was kind of fun!
  1798. > The first problem is: I don't want a text title for my popup menu. I want
  1799. > a framed rectangle containing the color selected from the menu. The second
  1800. > problem is, I don't know how to do that.
  1801. > I suppose I could fake it: just draw a rectangle and fill it with the
  1802. > desired color. But then how would I get the menu to appear? Should the
  1803. > popup be sitting near-by with a title width of 0? So many people implement
  1804. > this thing, there has to be a "right way" to do it. Even so, I haven't
  1805. > found any code examples to help me out.
  1806.  
  1807. I think what you want is to create a "fake" static menu item (the current
  1808. menu selection) , and then have your menu popup, right?  I think at the
  1809. moment you're using a popup menu cdef, and you have the attributes set
  1810. so that you have the attached label, right? Instead you should forgo the 
  1811. popup menu control, and do it the "old" way, before the cdef was released.
  1812.  
  1813. This is actually a common thing, except for the custom mdef.  What you do is use
  1814. PopupMenuSelect().  There's no control or cdef involved. 
  1815.  
  1816. For the static menu, you draw whatever you want the regular way,
  1817. the current color in a box, and a little downward-pointing triangle, or
  1818. whatever.  
  1819. Then when you get a click in the menu's rect, you call PopupMenuSelect() 
  1820. with your menu , and it operates just like the popup control would.  The trap
  1821. will tell you what item the user selected (if any), and then it goes away.   You
  1822. then take the new color, and redraw the static menu that way.
  1823. -- 
  1824. Uh…okay.
  1825.  
  1826. +++++++++++++++++++++++++++
  1827.  
  1828. >From jordanz@altura.com (Jordan Zimmerman)
  1829. Date: Fri, 17 Nov 1995 18:46:13 -0900
  1830. Organization: Altura Software, Inc.
  1831.  
  1832. In article <rajadhyaksha.2-1711951239120001@slip2-52.acs.ohio-state.edu>,
  1833. rajadhyaksha.2@osu.edu (Ram Rajadhyaksha) wrote:
  1834.  
  1835. > In article <mtrent-1711950002310001@azathoth.msn.fullfeed.com>,
  1836. > mtrent@msn.fullfeed.com (Michael Trent) wrote:
  1837. > > I suppose I could fake it: just draw a rectangle and fill it with the
  1838. > > desired color. But then how would I get the menu to appear? Should the
  1839. > > popup be sitting near-by with a title width of 0? So many people implement
  1840. > > this thing, there has to be a "right way" to do it. Even so, I haven't
  1841. > > found any code examples to help me out.
  1842. > Um, I haven't written an MDEF yet so I have limited knowledge about this
  1843. > but, couldn't you just call PopUpMenuSelect? Draw the color box yourself
  1844. > and call that trap when you have a mousedown in the area. It's the "old"
  1845. > way of doing a pop-up menu and I think it's described in IM V.
  1846. > I also think Apple distributes a sample source of this...
  1847. > -Ram
  1848.  
  1849. I've written a color picker MDEF. It's on AOL, alt.mac.sources, etc.
  1850.  
  1851. -- 
  1852. Jordan Zimmerman, Altura Software
  1853. home page: http://www.altura.com/jordanz
  1854. Spock's Beard: http://www.altura.com/spocks_beard
  1855.  
  1856. +++++++++++++++++++++++++++
  1857.  
  1858. >From kenlong@netcom.com (Ken Long)
  1859. Date: Sat, 18 Nov 1995 08:29:56 GMT
  1860. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1861.  
  1862. Michael Trent (mtrent@msn.fullfeed.com) wrote:
  1863.  
  1864. : I want to make a popup menu similar to the color pickers one finds in any
  1865. : program w/ graphic capabilities. You know what I mean: Go to ResEdit (for
  1866. : example), Edit a cicn, click on the color rectangles on the left side of
  1867. : the edit window, and presto! a cool color menu appears from which you can
  1868. : pick what color you want to plot.
  1869.  
  1870. You've asked about this before, haven't you?
  1871.  
  1872. I have worked on a duplicate of that ResEdit doo-dadd, but I keep getting 
  1873. side tracked, so it's not done.
  1874.  
  1875. : The first problem is: I don't want a text title for my popup menu. I want
  1876. : a framed rectangle containing the color selected from the menu. The second
  1877. : problem is, I don't know how to do that.
  1878.  
  1879. There was some old code that made a pie chart, called "PopPieSelect" or 
  1880. some such (B/W) that could help with that.  My floppy drive is down, so 
  1881. maybe someone else that has it could send it to you.
  1882.  
  1883. : I suppose I could fake it: just draw a rectangle and fill it with the
  1884. : desired color. But then how would I get the menu to appear? Should the
  1885. : popup be sitting near-by with a title width of 0? So many people implement
  1886. : this thing, there has to be a "right way" to do it. Even so, I haven't
  1887. : found any code examples to help me out.
  1888.  
  1889. You need to get up close and personal with the Tear-Off stuff (straight C 
  1890. source, buried in the Think Class Lib folder), because that's what the 
  1891. thing in ResEdit is.
  1892.  
  1893. It must work off PtInRect, which then draws the palette off that.  But 
  1894. then the tear-off stuff takes over if your mouse strays too far while 
  1895. StillDown.
  1896.  
  1897. The DTS.Draw source has a tear-off picture menu (so does Pictoid). 
  1898.  
  1899. Maybe the rectangle that triggers the palette in ResEdit is a Rgn, 
  1900. because the background one is partially obscured by the forecround one?
  1901.  
  1902. At any rate, whether you use an MDEF or not, the PtInXxxx is what it is 
  1903. oriented to initially.
  1904.  
  1905. That palette is drawn too quick to be a grid of colors, yet there is no 
  1906. 'PICT' resource in ResEdit (that I've seen) representing it.  But a 
  1907. 'PICT' would work.
  1908.  
  1909. If you tear it off, you drag a dotted ghost until you let up.  Then the 
  1910. palette becomes a floater and in the same place.
  1911.  
  1912. There must be some pictire or rectangle popup source around, which would 
  1913. operate similarly, to start off with.
  1914.  
  1915. A fixed floater, as in Color It, would be easier, since you wouln't have 
  1916. to pop it up.
  1917.  
  1918. If the source Jordan Zimmerman mentioned is one I have, it is excellent, 
  1919. and may give great insight as to how to duplicate the ResEdit thing.
  1920.  
  1921. Personally, I think Apple should release the source for ResEdit.  What 
  1922. harm could it do?  The program is free - why not the source?
  1923.  
  1924. -Ken-
  1925.  
  1926. +++++++++++++++++++++++++++
  1927.  
  1928. >From Dave Overton <doverton@iglou.com>
  1929. Date: Sat, 18 Nov 1995 14:12:31 GMT
  1930. Organization: DataStream Imaging Systems, Inc.
  1931.  
  1932. Michael,
  1933. I'd say the easy way to do it is to use old style PopUps- not the control
  1934. system 7 kind.
  1935. That way, you can draw your own popup title.
  1936. Dave Overton
  1937.  
  1938. +++++++++++++++++++++++++++
  1939.  
  1940. >From D.A.G.Gillies@bradford.ac.uk (Dave the Rave)
  1941. Date: Wed, 22 Nov 1995 16:36:26 GMT
  1942. Organization: Unseen University, Ankh-Morpork
  1943.  
  1944. In article <DI8ssv.GML@iglou.com> Dave Overton <doverton@iglou.com> writes:
  1945. >Michael,
  1946. >I'd say the easy way to do it is to use old style PopUps- not the control
  1947. >system 7 kind.
  1948. >That way, you can draw your own popup title.
  1949. >Dave Overton
  1950.  
  1951. That's right. The easiest way to do this (the only way as far as I can tell)
  1952. in ordinary Toolbox mode is to write your own MDEF, create a menu with
  1953. this MDEF ID, and pass the menu to PopupMenuSelect.
  1954.  
  1955. There is a set of classes in the Think Class Library that handles floating
  1956. windows and tearoffs, and another for handling arbitrary pop-up menus.
  1957. Check it out.
  1958.  
  1959. ______________________________________________________
  1960. @-|~ (Scientist formerly known as David A. G. Gillies)
  1961.                       (email: daggilli@bradford.ac.uk)
  1962. You are in a maze of kinky little fetishes,  all alike
  1963. (c) 1995 Wittgenstein's Amazing Underwater Supermarket
  1964. _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  1965.  
  1966.  
  1967. ---------------------------
  1968.  
  1969. >From grayowl1@aol.com (GrayOwl1)
  1970. Subject: [Q] How to hit-test a PICT?
  1971. Date: 27 Nov 1995 18:51:03 -0500
  1972. Organization: America Online, Inc. (1-800-827-6364)
  1973.  
  1974. Does anyone know how to check whether a given point is "inside" a PICT
  1975. (the PICT having been obtained from a PICT resource)? By inside, I mean
  1976. not just inside the picFrame, but inside the outline of whatever the
  1977. picture contains.
  1978.  
  1979. I know how to do this with a bitmap--get the mask of the bitmap and test
  1980. whether the pixel corresponding to the point is 1--but I can't figure out
  1981. how to do this with a PICT, without drawing the PICT into an offscreen
  1982. bitmap, converting it to a bitmap, etc.
  1983.  
  1984. Any ideas? Please e-mail to GrayOwl1@aol.com as well as this newsgroup.
  1985. Thanks in advance,
  1986.  
  1987. Regards,
  1988.  
  1989. Vinay Prabhakar
  1990. Gray Owl Software
  1991. - ---------------------------------------------------
  1992. "remember my name, I'll be famous someday"- anonymous
  1993. - ---------------------------------------------------
  1994.  
  1995. +++++++++++++++++++++++++++
  1996.  
  1997. >From starlabs@aol.com (StarLabs)
  1998. Date: 27 Nov 1995 22:37:35 -0500
  1999. Organization: America Online, Inc. (1-800-827-6364)
  2000.  
  2001. >>
  2002. Does anyone know how to check whether a given point is "inside" a PICT
  2003. (the PICT having been obtained from a PICT resource)? By inside, I mean
  2004. not just inside the picFrame, but inside the outline of whatever the
  2005. picture contains.
  2006. >>
  2007.  
  2008. One method I use is to create a region mask of the pict and save it as
  2009. a resource. When running your application, you could then load it when
  2010. needed, move it to the appropriate location, and use PtInRgn.
  2011.  
  2012. There's the extra effort in creating the region mask beforehand and
  2013. saving it as a resource - but I think this is better than drawing the
  2014. PICT offscreen and checking the corresponding pixel. It's just a matter
  2015. of technique preference in the end. A while back I wrote a utility
  2016. just to do what I mentioned: convert a PICT (preferably B&W) to a
  2017. region and save it as a resource. Email me if you're interested...
  2018.  
  2019.  
  2020. --Hiep
  2021.  
  2022. ---------------------------
  2023.  
  2024. >From jianhe@parker.EECS.Berkeley.EDU (JIAN HE)
  2025. Subject: multi-player keyboard control
  2026. Date: 25 Nov 1995 20:21:10 GMT
  2027. Organization: University of California, Berkeley
  2028.  
  2029.  
  2030. I want to know to write a multi-player keyboard control game. Right now I
  2031. have a maze game for one player. I try to add another player to the game but
  2032. there is a problem getting the keyboard events. I am using keyDown
  2033. + autoKeyMask for movement. When one player is holding down a key, the other
  2034. one can't move his character. How can I solve that problem?
  2035.  
  2036. Jian
  2037.  
  2038. +++++++++++++++++++++++++++
  2039.  
  2040. >From thebug@berlin.snafu.de (TheBug)
  2041. Date: Mon, 27 Nov 1995 18:54:48 +0100
  2042. Organization: privat
  2043.  
  2044. In article <497trm$ori@agate.berkeley.edu>,
  2045. jianhe@parker.EECS.Berkeley.EDU (JIAN HE) wrote:
  2046.  
  2047. > I want to know to write a multi-player keyboard control game. Right now I
  2048. > have a maze game for one player. I try to add another player to the game but
  2049. > there is a problem getting the keyboard events. I am using keyDown
  2050. > + autoKeyMask for movement. When one player is holding down a key, the other
  2051. > one can't move his character. How can I solve that problem?
  2052.  
  2053.  
  2054. The problem you are encountering is that the keyboard does not support
  2055. all-key-rollover. That means it can not decode the key matrix if too many
  2056. keys are pressed. You should be able to get two typing keys properly plus
  2057. all of the modifier keys, everything above that will be erratic. This is
  2058. part one of the problem.
  2059. Since you are using keyDown+autoKeyMask you don't get the key up events.
  2060. So I suppose you are expecting to get repeat events for both keys. The
  2061. keyboard driver is only generating repeat events for the key LAST pressed.
  2062. I would suggest you use keyDown+keyUp and do the repeat internally with a
  2063. timer task.
  2064.  
  2065. If you should decide to go to GetKeys instead, then please keep in mind
  2066. that there might be more then just the single keyboard generating key
  2067. events. If the user has a joystick connected the joystick will also
  2068. generate key events. And GetKeys reports only keys of the device that was
  2069. the last to send changes.
  2070.  
  2071. -- 
  2072. *******************************************************************
  2073. Guido Körber -            Programmer and hardware hacker 
  2074. thebug@berlin.snafu.de    Specialised in mistreating the ADB
  2075. fax: x49-30-773 81 36     Ask me about:
  2076.                            Flightstick Pro, Jetstick
  2077.                            MacEnjoy, MacEnjoy Style
  2078.  
  2079. Opinions expressed herein are mine unless expressly stated 
  2080. otherwise. Similarities with living or undead persons are
  2081. coincidence and not intended - really!   ;-)
  2082. Best use before: (see date printed on backside of message)
  2083. *******************************************************************
  2084.  
  2085. ---------------------------
  2086.  
  2087. End of C.S.M.P. Digest
  2088. **********************
  2089.